From: Florian Müllner Date: Tue, 11 Feb 2020 16:46:11 +0000 (+0100) Subject: unlockDialog: Support clock/prompt switching via scrolling X-Git-Tag: archive/raspbian/50.5-1+rpi1~1^2~777^2^2~55 X-Git-Url: https://dgit.raspbian.org/%22http://www.example.com/cgi/%22/%22http:/www.example.com/cgi/%22?a=commitdiff_plain;h=d43401cc74acc7b877b61353c6aaeafed83744cb;p=gnome-shell.git unlockDialog: Support clock/prompt switching via scrolling SwipeTracker "only" handles touch gestures and smooth scrolling. Scrolling still makes sense for regular mice as well though, so add handling for that as well. https://gitlab.gnome.org/GNOME/gnome-shell/merge_requests/972 --- diff --git a/js/ui/unlockDialog.js b/js/ui/unlockDialog.js index 1816689a3..d535a721b 100644 --- a/js/ui/unlockDialog.js +++ b/js/ui/unlockDialog.js @@ -443,6 +443,18 @@ var UnlockDialog = GObject.registerClass({ this._swipeTracker.connect('update', this._swipeUpdate.bind(this)); this._swipeTracker.connect('end', this._swipeEnd.bind(this)); + this.connect('scroll-event', (o, event) => { + if (this._swipeTracker.canHandleScrollEvent(event)) + return Clutter.EVENT_PROPAGATE; + + let direction = event.get_scroll_direction(); + if (direction === Clutter.ScrollDirection.UP) + this._showClock(); + else if (direction === Clutter.ScrollDirection.DOWN) + this._showPrompt(); + return Clutter.EVENT_STOP; + }); + this._activePage = null; let tapAction = new Clutter.TapAction();